﻿<?php
session_start();
$us['openid']=$_SESSION['openid'] ; 
require_once "jssdk.php";
$jssdk = new JSSDK("wxaf08bf0875489a04", "daf0bf4ad13aa340bbbfacf7afd21218");
$signPackage = $jssdk->GetSignPackage();?>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="apple-touch-fullscreen" content="yes" />
    <title>明晨出发</title>
   
    <style type="text/css">
        body, div, canvas
        {
            image-rendering: optimizeSpeed;
            -webkit-image-rendering: optimizeSpeed;
            -webkit-interpolation-mode: nearest-neighbor;
        }

        body{padding:0; margin:0;font-size:12px;background-color:rgba(72,196,230,0.5);}
        body, html{height: 100%;}
        #peach0, #peach1, #peach2, #peach3{color:#fff;font-size: 200px;}
        #outer{height:100%; overflow:hidden; position:relative; width:100%;}
        #outer[id]{display:table; position:static;}
        #middle{position:absolute; top:50%;} /* for ie only*/
        #middle[id]{display:table-cell; vertical-align:middle; position:static;}
    </style>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript" src="js/quark.base-1.0.0.alpha.min.js"></script>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/jquery.jplayer.min.js"></script>
   <!-- <script type="text/javascript" src="src/Audio.js"></script> -->
    <script type="text/javascript" src="src/Orientation.js"></script>
    <script type="text/javascript" src="src/Button.js"></script>
    <script type="text/javascript" src="src/main.js"></script>
    <script type="text/javascript" src="src/Peach.js"></script>
    <script type="text/javascript" src="src/Monkey.js"></script>
    <script type="text/javascript" src="src/Num.js"></script>

</head>

<body>
<img src="images/0begin-.png" width="0" height="0" />
<img id="cover" src="images/share.png" style="position: fixed;left:0;top:0;z-index: 999999;width: 100%;height: 100%;display: none;"/>
<div id="outer">
    <div id="middle">
        <div id="container" style="position:relative;top:-50%;width:100%;height:100%;margin:0 auto;">
        	
        	
        </div>
    </div>
</div>

<audio src="images/a.mp3" preload="auto" loop="true"></audio>

<script>
		
		  wx.config({
		    debug: false,
		    appId: '<?php echo $signPackage["appId"];?>',
		    timestamp: '<?php echo $signPackage["timestamp"];?>',
		    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
		    signature: '<?php echo $signPackage["signature"];?>',
		     jsApiList: [
		        'checkJsApi',
		      'onMenuShareTimeline',
		      'onMenuShareAppMessage',
		      'onMenuShareQQ',
		        'onMenuShareWeibo',
		        'onMenuShareQZone',
		        'hideMenuItems',
		        'showMenuItems',
		        'hideAllNonBaseMenuItem',
		        'showAllNonBaseMenuItem',
		        'translateVoice',
		        'startRecord',
		        'stopRecord',
		        'onVoiceRecordEnd',
		        'playVoice',
		        'onVoicePlayEnd',
		        'pauseVoice',
		        'stopVoice',
		        'uploadVoice',
		        'downloadVoice',
		        'chooseImage',
		        'previewImage',
		        'uploadImage',
		        'downloadImage',
		        'getNetworkType',
		        'openLocation',
		        'getLocation',
		        'hideOptionMenu',
		        'showOptionMenu',
		        'closeWindow',
		        'scanQRCode',
		        'chooseWXPay',
		        'openProductSpecificView',
		        'addCard',
		        'chooseCard',
		        'openCard'
		      ]
		  });
		  wx.ready(function () {
		    // 在这里调用 API
		     
		    wx.getLocation({
			    success: function (res) {
			        var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
			        var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
			        var speed = res.speed; // 速度，以米/每秒计
			        var accuracy = res.accuracy; // 位置精度
			       //alert(latitude);
			    },
			    cancel: function (res) {
			        alert('用户拒绝授权获取地理位置');
			       
			    }
			});
			wx.onMenuShareTimeline({
			    title: '明晨出发', // 分享标题
			    desc:'明晨出发是旅行公司',
			    link: 'http://www.mc5178.com/game/', // 分享链接
			    imgUrl: 'http://7.5178.applinzi.com/images/island-.png', // 分享图标
			    success: function (res) { 
			        // 用户确认分享后执行的回调函数
			       // alert("您分享朋友圈成功,恭喜您又多了一次游戏机会，距离大奖更近一步") 
			      //  localStorage.removeItem("true");
			        $("#cover").hide();
			        game.restart();
			    },
			    cancel: function (res) { 
			        // 用户取消分享后执行的回调函数
			        alert("您取消朋友圈分享，大奖正在等您，赶紧去告诉身边的小伙伴")
			    }
			});
			wx.onMenuShareAppMessage({
			    title: '明晨出发', // 分享标题
			    desc: '明晨出发是旅行公司', // 分享描述
			    link: 'http://www.mc5178.com/game/', // 分享链接
			    imgUrl: 'http://7.5178.applinzi.com/images/island-.png', // 分享图标
			    type: '', // 分享类型,music、video或link，不填默认为link
			    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
			    success: function () { 
			        // 用户确认分享后执行的回调函数
			        alert("分享好友成功")
			    },
			    cancel: function () { 
			        // 用户取消分享后执行的回调函数
			        alert("取消好友分享")
			    }
			});
			
					
		
		 });
</script>



</body>
</html>
